﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocialPlatformSDK.Model;
using SocialPlatformSDK.Services.Util;
using SocialPlatformSDK.Util;

namespace SocialPlatformSDK
{
    public class RenRenOAuthInfo : OAuthConfigruationBase<RenRenOAuthInfo>
    {
        public string API_KEY { get; private set; }

        public override void Init()
        {
            base.IfSaveAccessToken = true;
            base.Format = DataFormat.Json;
            base.APP_KEY = "";
            base.APP_SECRET = "";
            base.Authority = "https://graph.renren.com/";
            base.TokenIso = new SafeIsolatedStorage<AccessToken>("Renren_internal_token.dat");
            API_KEY = "";
            APIUrl = " https://api.renren.com/";

            CallBackUrl = "http://graph.renren.com/oauth/login_success.html";
            //OAuthUri = @"https://open.t.qq.com/cgi-bin/authorize?oauth_token={0}";
            //GetRequestToken = @"cgi-bin/request_token";
            GetAccessToken = @"oauth/token";

            //https://graph.renren.com/oauth/authorize?client_id=...&redirect_uri=http://graph.renren.com/oauth/login_success.html&response_type=token&display=popup
            Accredit = string.Format("{0}oauth/authorize?client_id={1}&response_type=code&redirect_uri={2}&scope=read_user_album+read_user_feed&display=touch", Authority, APP_KEY, CallBackUrl);

            base.AccessToken = new RenRenAccessToken();
            base.CodeToken = new RenRenCodeToken();
        }


      
    }
}
